import axios from 'axios'
import api from './Api'
import { ILoginData, IResponseData, IResponseError } from './CommonTypes'

/**
 * 博客登录系列接口类
 */
export default class LoginService {
    public static async login(data: ILoginData): Promise<IResponseData<object> | IResponseError> {
        const result = await axios.post(api['login_api'], {
            data
        }).catch(err => {
            console.log(err)
            return { data }
        })
        return result.data
    }
}